import request from "../utils/request"


// 登录类型
export interface loginType {
    token: string
}
//登录时传递的参数类型
export interface loginDataType {
    username: string,
    password: string
}
// 用户信息
export interface userInfoType {
    routes: string[];
    buttons: string[];
    roles: string[];
    name: string;
    avatar: string;
}




// 1、请求登录
export const reqLogin = (loginData: loginDataType) => {
    return request.post<null, loginType>(`/admin/acl/index/login`, loginData)
}

// 2、请求用户信息
export const reqUserInfo = () => {
    return request.get<null, userInfoType>(`/admin/acl/index/info`)
}

// 3、退出登录
export const reqLogout = () => {
    return request.post<null, null>(`/admin/acl/index/logout`)
}